//  Released under a BSD-style license. See License.txt
#import "MyController.h"
#import "THCalendarInfo.h"

@implementation MyController

- (IBAction)runTests:(id)sender
{
	THCalendarInfo * calInfo = [THCalendarInfo calendarInfo];
	
	NSLog(@"Month: %@", [calInfo monthName]);
	NSLog(@"Date: %i", [calInfo dayOfMonth]);
	NSLog(@"Day: %@", [calInfo dayName]);
	NSLog(@"Days in Month: %i\n\n", [calInfo daysInMonth]);

	[calInfo moveToPreviousDay];
	NSLog(@"-moveToPreviousDay");
	NSLog(@"Date: %i", [calInfo dayOfMonth]);
	NSLog(@"Day: %@\n\n", [calInfo dayName]);

	[calInfo moveToNextMonth];
	NSLog(@"-moveToNextMonth");	
	NSLog(@"Month: %@", [calInfo monthName]);
	NSLog(@"Date: %i", [calInfo dayOfMonth]);
	NSLog(@"Day: %@", [calInfo dayName]);	  
	NSLog(@"Days in Month: %i\n\n", [calInfo daysInMonth]);
	
	[calInfo moveToNextYear];
	NSLog(@"-moveToNextYear");
	NSLog(@"Month: %@", [calInfo monthName]);  
	NSLog(@"Date: %i", [calInfo dayOfMonth]);
	NSLog(@"Year: %i", [calInfo year]);
	NSLog(@"Day: %@", [calInfo dayName]);
	NSLog(@"Days in Month: %i\n\n", [calInfo daysInMonth]);
	
	[calInfo moveToFirstDayOfMonth];
	NSLog(@"-moveToFirstDayOfMonth");
	NSLog(@"Month: %@", [calInfo monthName]);  
	NSLog(@"Date: %i", [calInfo dayOfMonth]);	
	NSLog(@"Day: %@\n\n", [calInfo dayName]);
    
	[calInfo resetDateAndTimeToCurrent];
	NSLog(@"-resetDateAndTimeToCurrent");
	NSLog(@"NSDate rep: %@\n\n", [calInfo date]);

	[calInfo adjustDays:81];
	NSLog(@"-adjustDays:81");
	NSLog(@"Month: %@", [calInfo monthName]);  
	NSLog(@"Date: %i\n\n", [calInfo dayOfMonth]);
	
	[calInfo adjustDays:-81];
	NSLog(@"-adjustDays:-81");
	NSLog(@"Month: %@", [calInfo monthName]);  
	NSLog(@"Date: %i\n\n", [calInfo dayOfMonth]);
	
	// class methods
	NSLog(@"+currentHour: %i", [THCalendarInfo currentHour]);
	NSLog(@"+currentMinute: %i", [THCalendarInfo currentMinute]);
	NSLog(@"+currentSecond: %i", [THCalendarInfo currentSecond]);		
	
}

@end
